Hi AB,
Regarding the 90us callback: It isn't really a matter of the Thread terminating. Once a callback is configured to execute code in a Thread space it will continue to call that code regardless of whether the Thread is executing or not. The important thing is that the code in the Thread Space is not changed before the callback is stopped. The code below can be used to stop the callback. This can be executed from any Thread. The system never automatically disables the callback. It is up to you to do this in a way that makes sense for you.
#include "KMotionDef.h"
main()
{
UserCallBack = NULL; // stop the callback
}
You should probably spend less than 10us in the callback. It depends on how much time the system is using for updating all the Axis and other system requirements and how much time you are willing to steal from the system and your other Threads. The example Measure IRQ.c can give an indication of how much time is available for your configuration.
Regarding SPI: I doubt if you will be able to bit bang at 10MHz. We discussed this in the following Thread and I believe the rate was ~450KHz
You might consider doing this in a User Thread. This would result in an update time of 180us or more, but depending on your requirements (servo bandwidth) it may not be an issue. For example with a bandwidth of 50Hz an extra 90us of delay will reduce the phase margin by only:
90us/20ms x 360 degrees = 1.62 degrees.
HTH
Regards
TK
| Group: DynoMotion |
Message: 10983 |
From: Hardy Family |
Date: 2/2/2015 |
| Subject: Re: 90us callback |